package xyz.fefine;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by feng_ on 2016/9/9.
 * 基础的变量类
 *
 */
public class BasicEnv implements Enviorment {
    protected Map<String,Object> values;
    BasicEnv(){
        values = new HashMap<>();
    }
    @Override
    public void put(String name, Object value) {
        values.put(name,value);
    }

    @Override
    public Object get(String name) {
        return values.get(name);
    }

    @Override
    public void setOuter(Enviorment outer) {

    }

    @Override
    public void putNew(String name, Object value) {
        this.put(name,value);
    }

    @Override
    public Enviorment where(String name) {
        return this.get(name) == null ? null : this;
    }

    @Override
    public void put(int nest, int index, Object value) {

    }

    @Override
    public Object get(int nest, int index) {
        return null;
    }

    @Override
    public Symbols symbols() {
        return null;
    }

    public Map<String,Object> getValues() {
        return values;
    }
}
